package junior.db.dao.base;

import junior.db.dao.query.AbstractQuery;

public class SubQuery extends AbstractQuery<SubQuery> implements IEntityTypeAssigned {
    private AbstractQuery<?> query;
    private String alias;
    
    public <Q extends AbstractQuery<?>> SubQuery(Q query) {
        this.query = query;
        this.alias = query.getPrefix();
    }

	public <Q extends AbstractQuery<?>> SubQuery(Q query, String alias) {
        this.query = query;
        this.alias = alias;
    }
    
    public AbstractQuery<?> getQuery() {
        return query;
    }
    
    public String getAlias() {
        return alias;
    }
}
